/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.cggveritas.crewintranet.jms.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Alassane
 */
@Entity
@Table(name = "cv_docofficiels")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CvDocofficiels.findAll", query = "SELECT c FROM CvDocofficiels c"),
    @NamedQuery(name = "CvDocofficiels.findById", query = "SELECT c FROM CvDocofficiels c WHERE c.id = :id"),
    @NamedQuery(name = "CvDocofficiels.findByNumerocardeidentite", query = "SELECT c FROM CvDocofficiels c WHERE c.numerocardeidentite = :numerocardeidentite"),
    @NamedQuery(name = "CvDocofficiels.findByScancarteidentite", query = "SELECT c FROM CvDocofficiels c WHERE c.scancarteidentite = :scancarteidentite"),
    @NamedQuery(name = "CvDocofficiels.findByScanvisa", query = "SELECT c FROM CvDocofficiels c WHERE c.scanvisa = :scanvisa"),
    @NamedQuery(name = "CvDocofficiels.findByDateexpirationvisa", query = "SELECT c FROM CvDocofficiels c WHERE c.dateexpirationvisa = :dateexpirationvisa")})
public class CvDocofficiels implements Serializable {
    @Column(name = "numerovisa")
    private String numerovisa;
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Column(name = "numerocardeidentite")
    private String numerocardeidentite;
    @Column(name = "scancarteidentite")
    private String scancarteidentite;
    @Column(name = "scanvisa")
    private String scanvisa;
    @Column(name = "dateexpirationvisa")
    @Temporal(TemporalType.DATE)
    private Date dateexpirationvisa;
    @JoinColumn(name = "cv_travailleur_id", referencedColumnName = "id")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private CvTravailleur cvTravailleurId;

    public CvDocofficiels() {
    }

    public CvDocofficiels(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNumerocardeidentite() {
        return numerocardeidentite;
    }

    public void setNumerocardeidentite(String numerocardeidentite) {
        this.numerocardeidentite = numerocardeidentite;
    }

    public String getScancarteidentite() {
        return scancarteidentite;
    }

    public void setScancarteidentite(String scancarteidentite) {
        this.scancarteidentite = scancarteidentite;
    }

    public String getScanvisa() {
        return scanvisa;
    }

    public void setScanvisa(String scanvisa) {
        this.scanvisa = scanvisa;
    }

    public Date getDateexpirationvisa() {
        return dateexpirationvisa;
    }

    public void setDateexpirationvisa(Date dateexpirationvisa) {
        this.dateexpirationvisa = dateexpirationvisa;
    }

    public CvTravailleur getCvTravailleurId() {
        return cvTravailleurId;
    }

    public void setCvTravailleurId(CvTravailleur cvTravailleurId) {
        this.cvTravailleurId = cvTravailleurId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CvDocofficiels)) {
            return false;
        }
        CvDocofficiels other = (CvDocofficiels) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "fr.cggveritas.crewintranet.jms.entities.CvDocofficiels[ id=" + id + " ]";
    }

    public String getNumerovisa() {
        return numerovisa;
    }

    public void setNumerovisa(String numerovisa) {
        this.numerovisa = numerovisa;
    }
    
}
